package org.example;

import org.example.common.Invocation;
import org.example.protocol.HttpClient;
import org.example.proxy.ProxyFactory;

public class Consumer {
    public static void main(String[] args) {
        //动态代理
        HelloService helloService  = ProxyFactory.getProxy(HelloService.class);
        String result = helloService.sayHello("go");
        System.out.println(result);


//        Invocation invocation = new Invocation(HelloService.class.getName(),"sayHello","1.0"
//                ,new Class[]{String.class},new Object[]{"dog"});
//
//        HttpClient httpClient = new HttpClient();
//        String localhost = httpClient.send("localhost", 8080, invocation);
//        System.out.println(localhost);
    }
}
